\section{Electronic description.}

A 9V alcaline battery is used as power source, and a
\href{http://www.alldatasheet.com/datasheet-pdf/pdf/105719/FAIRCHILD/LM7805A.html}{LM78L05}
voltage regulator assures a reliable 5V power feed.

The development of the altimeter is based on a
\href{http://en.wikipedia.org/wiki/PIC_microcontroller}{PIC} family
microcontroller, more specifically the
\href{http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010114}{PIC12F675}
model in it's 8 pins PDIP version.

It has a \href{http://en.wikipedia.org/wiki/Harvard_architecture}{Harvard}
achitecture (data and instructions are stored in different regions of the
computer, in contrast to
\href{http://en.wikipedia.org/wiki/Von_Neumann_architecture}{von Neumann}
achitecture). It's a
\href{http://en.wikipedia.org/wiki/Reduced_instruction_set_computer}{RISC}
(Reduced Instruction Set Computer) 8 bit microcontroller with only 35 one word
instructions (14 bits each) based on
\href{http://en.wikipedia.org/wiki/Flash_memory}{FLASH} -
\href{http://en.wikipedia.org/wiki/CMOS}{CMOS} technology.

It has diverse integrated periferals:
\begin{itemize}

\item 6 pins for programmable Input/Output.
\item 2 integrated timer/counters of 8 and 16 bits respectively.
\item A/D converter with 4 channels and 10 bits of resolution.
\item Analog comparator.

\end{itemize}

Almost all the pins of this microcontroller are multifunction, and the
desired functionality can be chosen by programming special internal
registers.

The other fundamental component of this project is the pressure
\href{http://en.wikipedia.org/wiki/Sensor}{sensor}
\href{http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPX5100&fsrch=1}{MPX5100A}.
It is a piezo-resistive transducer that delivers a voltage between
0.2V and 4.7V proportional to the pressure it is being subject to.
 
The work range is between \href{http://en.wikipedia.org/wiki/Pressure}{15\,kPa to 115\,kPa}.
The sensor output voltage can be directly connected to the analog/digital converter, which can 
transform it into a numerical value of the absolute pressure, that can be related to the height at which
the vector is located.
The altimeter implements an algorithm for the estimation of the maximum altitude attained in meters.

An acustic beacon, according to established protocol, announces after touch
down an estimation of the altitude reached by the rocket. Every time the
altimeter is powered on, the last altitude estimation is broadcast. A buzzer
is used for the generation of acustic signals, and light signals are generated
by a high brigthness \href{http://en.wikipedia.org/wiki/Light-emitting_diode}{LED}.

Two pins of the microcrontroller, configured as outputs, are used to command
\href{http://en.wikipedia.org/wiki/MOSFET}{MOSFET} 
\href{http://www.tranzistoare.ro/datasheets/166/283672_DS.pdf}{IRF510}
transistors, which are used to ignite the ejection charges of
drogue and main recovery system. Two other pins, configured as inputs, are used
to check the continuity of ejection charges.

The list of materials, a diagram of electric connections of the system, the
layout of the PCB and the final physical disposition of all
electronic components is presented in the next sections.

\subsection{Bill of materials.}

\vspace{1cm}

\begin{tabular}{|c|c|c|c|c|} \hline 
\textbf{Part} & \textbf{Value}  & \textbf{Name} & \textbf{Presentation}  & \textbf{Comments} \\ \hline \hline
MPX5100A &   & MPX5100A      &   & Freescale absolute barometric sensor \\ \hline
IC1      &                 & PIC12F675     &  DIL8          & Microchip microcontroller \\ \hline
IC2      &                 & 78L05         &  TO92          & Voltage regulator \\ \hline
BUZZER   &                 & Buzzer 12\,V  &  $\Phi$=11\,mm & With oscillator \\ \hline
LED1     &                 & LED       &  $\Phi$=5\,mm  & Red, high intensity \\ \hline
Q1       &                 & IRF510    &  TO220         & FET \\ \hline
Q2       &                 & IRF510    &  TO220         & FET \\ \hline
T1       &                 & BC337     &  TO92          & NPN \\ \hline 
C1       & 0.47\,$\mu$F    & Capacitor &  & Electrolytic 25\,V-50\,V \\ \hline 
C2       & 1000\,$\mu$F    & Capacitor &  & Electrolytic 10\,V \\ \hline
C3       & 0.01\,$\mu$F    & Capacitor &  & Ceramic (103) \\ \hline
C4       & 0.01\,$\mu$F    & Capacitor &  & Ceramic (103) \\ \hline
C5       & 0.01\,$\mu$F    & Capacitor &  & Ceramic (103) \\ \hline
R1       & 100\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline 
R2       & 10K\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
R3       & 10K\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
R4       & 100K\,$\Omega$  & Resistor  &  & 0.25\,W \\ \hline
R5       & 47K\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
R6       & 100K\,$\Omega$  & Resistor  &  & 0.25\,W \\ \hline
R7       & 47K\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
R8       & 10K\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
R9       & 1K\,$\Omega$    & Resistor  &  & 0.25\,W \\ \hline
R10      & 650\,$\Omega$   & Resistor  &  & 0.25\,W \\ \hline
X1  &  & ON/OFF Jumper &          & 2 pins  \\ \hline
X2  &  & Connector      &          & 2 pins for 9\,V battery \\ \hline
X3  &  & Connector      &          & 2 pins for drogue ejection charge \\ \hline
X4  &  & Connector      &          & 2 pins for principal ejection charge \\ \hline
X5  &  & Jumper         &          & 4 pins for RS232 communication \\ \hline

\end{tabular}

\newpage
\subsection{Electrical diagram.}

\begin{center}
\rotatebox{270}{\scalebox{0.385}{\includegraphics{circuito.png}}}
\end{center}

\newpage
\subsection{One side PCB and components layout.}

A one side version of the circuit, along with the mask of components layout
is included, so that anyone interested is able to build it's own printed
circuit using any of the techniques available  on Internet.
\begin{center}

\begin{tabular}{c}
\\
\Huge{Components mask} \\
\\
\includegraphics{mascara_componentes.png} \\
\\
\Huge{One side PCB} \\
\\
\scalebox{0.24}{\includegraphics{impreso.png}} \\ 
\end{tabular}

\end{center}

\newpage
\subsection{Double side PCB and component layout.}

As stated in the introduction, this double sided design improves the layout of
power and pressure sensor signal. To build this kind of printed circuit,
professional assistance is advised. Homemade construction is possible, but
much more complex than one sided printed circuits because everything must be
precisely aligned.

\begin{center}

\begin{tabular}{c}
\\
\Huge{Components mask} \\
\\
\includegraphics{mascara_componentes.png} \\
\\
\Huge{PCB top face} \\
\\
\includegraphics{top.png} \\
\\
\Huge{PCB bottom face} \\
\\
\includegraphics{bottom.png} \\
\end{tabular}

\end{center}

\newpage
\subsection{Final assembly.}

After a few tests, some minor changes were introduced in the circuit to
simplify and improve it's operation. These modifications do not alter the
printed circuit, but change the way some of the components are assembled:

\begin{itemize}
\item \texttt{R1} (100\,$\Omega$) should be replaced by a bridge.
\item \texttt{R9} (1\, K$\Omega$) should be replaced by a bridge in case a 12\,V buzzer is used.
\item Capacitors \texttt{C4} and \texttt{C5} (0.01\,$\mu$F) are optional and can be omitted.
\item Capacitor \texttt{C2} (1000\,$\mu$F) is optional. The altimeter
  has been tested and worked fine without it.
\end{itemize}

All diagrams and drawings were created using
\href{http://www.cadsoft.de/}{Eagle} CAD. This package, along with
\href{http://www.matwei.de/doku.php?id=en:eagle3d:eagle3d}{Eagle3D} and
\href{www.povray.org}{PovRay}, allow the creation of 3D virtual renderings that can give you an idea
of what the electronic device should look like once finished.

A few virtual renderings can be compared to the final assembly of the
first prototype unit built:

\begin{center}
\begin{tabular}{cc}
\scalebox{0.15}{\includegraphics{Vista1_3D.jpg}} &
\scalebox{0.15}{\includegraphics{Vista2_3D.jpg}} \\
Virtual view \#1 & Virtual view \#2 \\
\scalebox{0.12}{\includegraphics{Vista1_Foto.jpg}} &
\scalebox{0.12}{\includegraphics{Vista2_Foto.jpg}} \\
Real view \#1 & Real view \#2 \\
\end{tabular}
\end{center}

For this version of the altimeter, the final PCB were ordered to
\href{http://www.mayerpcb.com.ar}{Ernesto Mayer S.A.}. The excelent quality of
the construnction can be appreciated in the following images :

\begin{center}
\begin{tabular}{c}
\scalebox{0.195}{\includegraphics{alfa_06_presentacion_de_componentes.jpg}} \\
New board and components \\
\scalebox{0.15}{\includegraphics{alfa_31_comparativa_con_el_prototipo.jpg}} \\
Prototype and new board version assembled
\end{tabular}
\end{center}

\subsection{Loading of Firmware.}

The necessary firmware to operate the altimeter can be delivered by
email \footnote{\textbf{altimetro\_dmtc2@yahoo.com.ar}}, already
compiled (.HEX) to whom may be interested. It can be loaded using the
appropriate programmer compatible with PIC12F675 MicroChip series.

Precautions should be taken to preserve the calibration value of the internal
oscillator that is stored in the last memory address (03FF) of the PIC. The correct
operation of the firmware programmed on the microcontroller depends on it.

Some PIC programming systems takes care of this fact, but many others don't. Search
the documentation of the programmer to check this.

As a precaution, it's advisable to read the PIC before programming , and write
down this value as a safety backup. If this value is erased when the HEX file
is loaded in the programming system, it can be restored before the uploading of
the firmware takes place.
